from django.contrib.auth.models import User,Permission,Group
from rest_framework import serializers
from .models import*

class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = '__all__'
        depth = 2

class PermissionSerializer(serializers.ModelSerializer):
    class Meta:
        model = Permission
        fields = '__all__'
        depth = 1

class GroupSerializer(serializers.ModelSerializer):
    class Meta:
        model = Group
        fields = '__all__'
        depth = 1

class GroupSerializerNoDepth(serializers.ModelSerializer):
    class Meta:
        model = Group
        fields = '__all__'